// pages/talk/talk.js
var localData = require('../../data/localData.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    talkList: []
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    // this.data.talkList = talkData.talkList;
    this.setData({
      talkList: localData.localList
    })
  },
  showDialog() {
    this.dialog.showDialog();
  },

  //取消事件
  _cancelEvent() {
    console.log('你点击了取消');
    this.dialog.hideDialog();
  },
  //确认事件
  _confirmEvent() {
    console.log('你点击了确定');
    this.dialog.hideDialog();
  },
  detailTap: function (event) {
    var id = event.currentTarget.dataset.id;
    wx.navigateTo({
      url: 'talk-detail/talk-detail?id=' + id,
    })
  },
  /**
  * 上拉加载
  */
  onScrollLower: function (event) {
    // wx.showNavigationBarLoading();
  },
  /**
  *下拉刷新
  */
  onPullDownRefresh : function () {
    wx.startPullDownRefresh();
    console.log("下拉刷新");
  },
  onReachBottom :function(){
    console.log("上拉加载");
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    //获得dialog组件
    this.dialog = this.selectComponent("#dialog");
  },


})